<template>
  <div class="login">
    <div class="login_main">
      <h2>登录智能云平台</h2>
      <el-form :inline="true" :model="form" class="demo-form-inline">
        <el-form-item>
          <el-row>
            <el-col :span="24">
              <el-input v-model="form.phone" placeholder="请输入手机号码"></el-input>
            </el-col>
          </el-row>
          <el-input type="password" v-model="form.password" placeholder="请输入密码"></el-input>
        </el-form-item>
        <el-form-item class="submitRegister">
          <el-button type="success" @click="login()">登录</el-button>
        </el-form-item>
      </el-form>

      <el-button type="text" class="go-back-login">返回账号登录</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      form: {
        phone: "",
        password: ""
      }
    };
  },
  methods: {
    login() {
      if (this.form.phone == "") {
        this.$alert("请输入手机号码", "温馨提示", {
          confirmButtonText: "确定",
          callback: action => {
            // this.$message({
            //   type: "info",
            //   message: `action: ${action}`
            // });
          }
        });
      }
      this.$router.push("home")
    }
  }
};
</script>

<style lang="less">
@import "../../style/color.less";
.login {
  position: absolute;
  left: 50%;
  top: 50%;
  -ms-transform: translate(-50%, -50%); /* IE 9 */
  -moz-transform: translate(-50%, -50%); /* Firefox */
  -webkit-transform: translate(-50%, -50%); /* Safari 和 Chrome */
  transform: translate(-50%, -50%);
  width: 550px;
  margin: 0 auto;
  h2 {
    margin-bottom: 70px;
    font-size: 40px;
  }
  input {
    width: 100%;
    margin-bottom: 30px;
    height: 50px;
    line-height: 50px;
    font-size: 20px;
  }
  .el-input__inner {
    padding: 0 8px;
  }
  .el-input.is-disabled .el-input__inner {
    background-color: transparent;
  }
  .area-code {
    margin-right: 4.16667%;
  }
  .getverificationCode {
    margin-left: 4.16667%;
    text-align: center;
    button {
      width: 100%;
      height: 50px;
      font-size: 20px;
    }
  }
  .el-form-item {
    width: 100%;
    margin: 0;
    .el-form-item__content {
      width: 100%;
    }
  }
  .submitRegister {
    width: 100%;
    .el-form-item__content {
      width: 100%;
      button {
        width: 100%;
        background-color: @themeColor;
        border-color: @themeColor;
        height: 50px;
        font-size: 20px;
      }
    }
  }
  .go-back-login {
    color: #333333;
    font-size: 16px;
    margin-top: 10px;
  }
}
</style>